from prj005.serializers import AllSerializer


def get_excel_needed(obj):
    inner_data = {}

    try:
        inner_data['summary'] = obj.summary
    except Exception:
        inner_data['summary'] = None

    try:
        inner_data['history'] = obj.history
    except Exception:
        inner_data['history'] = None

    try:
        inner_data['clinical'] = obj.clinical
    except Exception:
        inner_data['clinical'] = None

    try:
        inner_data['cure'] = obj.cure
    except Exception:
        inner_data['cure'] = None

    try:
        inner_data['result'] = obj.result
    except Exception:
        inner_data['result'] = None

    try:
        inner_data['relevant'] = obj.relevant
    except Exception:
        inner_data['relevant'] = None

    inner_data['info'] = obj

    all_object_data = AllSerializer(inner_data)

    return all_object_data.data
